package cn.alibab.news.service.impl;

import cn.alibab.common.model.PageBean;
import cn.alibab.common.model.R;
import cn.alibab.news.mapper.SykNewsAlarmMapper;
import cn.alibab.news.model.SykNewsAlarm;
import cn.alibab.news.model.SykNewsAlarmExample;
import cn.alibab.news.service.NewsAlarmService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shiyk
 * @create 2020-07-16 17:49
 */
@Service
public class NewsAlarmServiceImpl implements NewsAlarmService {
    private final SykNewsAlarmMapper sykNewsAlarmMapper;

    public NewsAlarmServiceImpl(SykNewsAlarmMapper sykNewsAlarmMapper) {
        this.sykNewsAlarmMapper = sykNewsAlarmMapper;
    }


    @Override
    public R getAlarm() {
        SykNewsAlarmExample example = new SykNewsAlarmExample();
        example.createCriteria();
        List<SykNewsAlarm> sykNewsAlarms = sykNewsAlarmMapper.selectByExample(example);
        return R.ok(sykNewsAlarms);
    }
}
